<template>
  <div class="demo">
    <button @click="isShow=!isShow">显示/隐藏</button>
    <transition appear>
      <h2 v-show="isShow">{{ name }}</h2>
    </transition>
  </div>
</template>

<script>
export default {
  name: "School",
  data() {
    return {
      name: "你好啊",
      schoolName:'尚硅谷',
      isShow: true
    }
  }
}
</script>

<style scoped>
h2 {
  background-color: skyblue;
}

.v-enter-active {
  animation: atguigu 1s;
}

.v-leave-active {
  animation: atguigu 1s reverse;
}

@keyframes atguigu {
  from {
    transform: translateX(-100px);
  }
  to {
    transform: translateX(0px);
  }
}
</style>
